package com.hoshiicloud.user.feign.hystrix;

import com.hoshiicloud.common.rpc.Response;

import com.hoshiicloud.user.feign.INeo4jService;
import com.hoshiicloud.user.param.rbac.RObject;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @program: hoshiicloud
 * @description: 文件服务熔断
 * @author: Mr.wu
 * @create: 2019-06-04 10:59
 **/
@Component
@Slf4j
public class Neo4jServiceFeignFallbackFactory implements FallbackFactory<INeo4jService> {
    @Override
    public INeo4jService create(Throwable throwable) {
        log.error("fallback; reason was:"+throwable.toString());
        return new INeo4jService(){
            @Override
            public Response createTenant(String tenant) {
                return null;
            }

            @Override
            public Response createOrganization(String org) {
                return null;
            }

            @Override
            public Response createPlatform(String param) {
                return null;
            }

            @Override
            public Response addRole(RObject param) {
                return null;
            }

            @Override
            public Response addDept(RObject param) {
                return null;
            }
        };
    }
}
